<!DOCTYPE html>
<html>
<head lang="en">
    <meta charset="UTF-8">
    <title>我的首页</title>
    <link rel="stylesheet" href="/stylesheets/style.css">
</head>
<body>
<header>
    <h1><%= title %></h1>
</header>
<nav>
    <span><a href="/" title="首页">主页</a></span>
    <span><a href="/article/archive">存档</a></span>
    <span><a href="/article/tags">标签</a></span>
    <% if (user) { %>
    <span><a href="/article/post">发布</a></span>
    <span><a href="/file/upload">上传</a></span>
    <span><a href="/user/logout">退出</a></span>
    <% } else { %>
    <span><a href="/user/login" title="登录">登录</a></span>
    <span><a href="/user/reg" title="注册">注册</a></span>
    <% } %>
    <!--新增搜索功能-->
    <span>
        <form action="/search" method="get">
            <input class="search" type="text" placeholder="SEARCH" name="keyword">
        </form>
    </span>
</nav>
<article>
    <% if (success) { %>
    <div><%= success %></div>
    <% } %>
    <% if (error) { %>
    <div><%= error %></div>
<% } %>